import 'package:flutter/material.dart';
import 'package:flutter/services.dart';


class SwitchAndCheckboxPage extends StatelessWidget {
  final SystemUiOverlayStyle _style = SystemUiOverlayStyle(statusBarColor: Colors.transparent);
  @override
  Widget build(BuildContext context) {
    SystemChrome.setSystemUIOverlayStyle(_style);
    // TODO: implement build
    return MaterialApp(
      home: SwitchAndCheckboxWidget(),
      theme: ThemeData(primarySwatch: Colors.yellow),
    );
  }
}

class SwitchAndCheckboxWidget extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return _SwitchAndCheckboxPage();
  }
}

class _SwitchAndCheckboxPage extends State<StatefulWidget> {

  bool checkValue  = false;
  bool switchValue = false;

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      appBar: AppBar(
        title: Text("SwitchAndCheckbox Page"),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Checkbox(value: checkValue, onChanged: (value){
              setState(() {
                checkValue = value;
              });
            }),
            Switch(value: switchValue, onChanged: (value){
              setState(() {
                switchValue = value;
              });
            })
          ],
        ),
      ),
    );
  }
}